from django.db import models
from django0924.utils.models import BaseModel
# Create your models here.
class NavModel(BaseModel):
    POSITION_CHOICES={
        (0,'顶部导航'),
        (1,'底部导航'),
    }
    link= models.CharField(max_length=100, verbose_name='链接')
    is_http=models.BooleanField(default=False, verbose_name='是否是http链接')
    position=models.IntegerField(choices=POSITION_CHOICES, default=0, verbose_name='位置')
    class Meta:
        db_table="fg_nav"
        verbose_name='导航菜单'
        verbose_name_plural=verbose_name
class BannerModel(BaseModel):
    image=models.ImageField(upload_to='banner/%Y/',verbose_name='图片地址',null=True)
    link= models.CharField(max_length=255, verbose_name='轮播点击链接')
    note=models.CharField(max_length=255, verbose_name='备注')
    is_http=models.BooleanField(default=False, verbose_name='是否是http链接',help_text='站点外部链接：http://www.baidu.com <br> 站点内连接')
    class Meta:
        db_table="fg_banner"
        verbose_name_plural='轮播广告图'